#ifndef CAFFEINE_PHYSICS_PHYSWORLD_HPP
#define CAFFEINE_PHYSICS_PHYSWORLD_HPP

#include "Math/Vector.hpp"

#include "Box2D/Dynamics/b2Body.h"
#include "Box2D/Dynamics/b2World.h"

namespace Physics
{
	class PhysWorld
	{
		friend class IBody;
	public:
		PhysWorld( void );
		~PhysWorld( void );

		void Step( const float interval, const int iterations );

		Math::Vectorf GetGravity( void ) const;
		void SetGravity( Math::Vectorf &grav );
	private:
		b2Body *CreateInternalBody( b2BodyDef *def );
		void RemoveInternalBody( b2Body *body );

		b2World *world;
	};
}

#endif //CAFFEINE_PHYSICS_PHYSWORLD_HPP